@extends('admin.base.index')
@section('content')
	<form action="" method="post" name="myform">
				<input type="hidden" name="_token" value="{{ csrf_token() }}">
				<input type="hidden" name="_method" value="delete">
	</form>

			<form action='' method='get'>
			        <div class='media-body'>
			            订单号：<input type='text' class='form-control m-b-5' name='name'>
			        </div>
			        <input type='submit' class='btn' value='搜索'>
			</form>
	            <table class="table tile">
	                <thead>
	                    <tr>
	                        <th>订单号</th>
	                        <th>商品详情</th>
	                        <th>收货人</th>
	                        <th>联系方式</th>
	                        <th>收货地址</th>
	                        <th>订单物流</th>
	                        <th>操作</th>
	                    </tr>
	                </thead>
	                <tbody>
	                @foreach($list as $v)
	                    <tr>
	                        <td>{{ $v->id }}</td>
	                        <td>{{ $v->detail }}</td>
	                        <td>{{ $v->name }}</td>
	                        <td>{{ $v->phone }}</td>
	                        <td>{{ $v->address }}</td>
	                        <td>
		                      @if($v->state == 1)
									未付款
		                      @endif
		                      @if($v->state != 1)
									已付款,正在发货
		                       @endif
	                        </td>
	                        <td>
	                        	<a href="{{ url('admin/order') }}/{{ $v->id }}/edit">修改状态</a> | 
	                        	<a href="javascript:doDel({{$v->id}})">删除</a>
	                        </td>
	                    </tr>
	                @endforeach
	                </tbody>
	            </table>
	        <script type="text/javascript">
					function doDel(id){
						if(confirm("是否删除？")){
							var a = document.myform;
							a.action = "{{ url('admin/order') }}/"+id;
							a.submit();
						}
					}
			</script>
	{{ $list->appends($where)->links() }}
	       
@stop